package com.sugar.psych.assessment.module.business.controller.app.userpointsrecord;

import com.sugar.psych.assessment.framework.common.pojo.CommonResult;
import com.sugar.psych.assessment.framework.security.core.util.SecurityFrameworkUtils;
import com.sugar.psych.assessment.module.business.controller.app.userpointsrecord.vo.AppUserPointsRecordRespVO;
import com.sugar.psych.assessment.module.business.controller.app.userpointsrecord.vo.AppUserPointsRespVO;
import com.sugar.psych.assessment.module.business.service.userpointsrecord.UserPointsRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

import static com.sugar.psych.assessment.framework.common.pojo.CommonResult.successApp;

@Tag(name = "APP - 用户积分记录")
@RestController
@RequestMapping("/psych/user-points-record")
@Validated
public class AppUserPointsRecordController {

    @Resource
    private UserPointsRecordService userPointsRecordService;

    @GetMapping
    @Operation(summary = "获得用户积分记录")
    public CommonResult<AppUserPointsRespVO> getUserPointsRecord() {
        return successApp(userPointsRecordService.appGetUserPointsRecord(SecurityFrameworkUtils.getLoginUserId()));
    }
}